package com.nuonuo.nuo_xp;

import android.util.Base64;

import java.security.spec.AlgorithmParameterSpec;

import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;

/**
 * @author glsite.com
 * @version $Rev$
 * @des ${TODO}
 * @updateAuthor $Author$
 * @updateDes ${TODO}
 */

public class AES {
    private static String jiami_text="nuonuo";
    public static String get_aes() throws Exception {
        SecretKeySpec key = new SecretKeySpec("1234567890abcdef1234567890abcdef".getBytes(), "AES");
        AlgorithmParameterSpec iv = new IvParameterSpec("1234567890abcdef".getBytes());
        Cipher aes = Cipher.getInstance("AES/CBC/PKCS5Padding");
        aes.init(1, key, iv);
        return Base64.encodeToString(aes.doFinal(jiami_text.getBytes("UTF-8")), 0);
    }
}